<?python 
  
  from whatwhat.utils import textilize, getGroups
  from turbogears.i18n.format import format_date
  from turbogears import identity
 
  groupids = getGroups()
  
?>

<li xmlns:py="http://purl.org/kid/ns#" id="note_$note.id" class="note" onmouseover="show_inline('remove_note_link_$note.id');show_inline('edit_note_link_$note.id')" onmouseout="hide('remove_note_link_$note.id'); hide('edit_note_link_$note.id');">
	<div class="note_content" id="note_content_$note.id">
		<div>${XML(textilize(note.note))}</div>
		<div py:if="note.last_edit_date != None"><i>Last edited: ${format_date(note.last_edit_date, time_format=' %I:%M %p')}</i></div>
		<br/>
		<div class="note_info">
			<span>
			Posted by <a class="note_creator" href="mailto:$note.creator.emailAddress">${note.creator.displayName}</a> 
			on ${format_date(note.creation_date, time_format=' %I:%M %p')}
			</span>
			<a py:if="(identity.current.user == note.creator or 'admin' in groupids) and not read_only" style="display: none" id="edit_note_link_$note.id" href="#" class="edit_note_link" onclick="request_note_content($note.id); return false;">edit</a>
			<a py:if="(identity.current.user == note.creator or 'admin' in groupids) and not read_only" style="display: none" id="remove_note_link_$note.id" href="#" class="remove_note_link" onclick="remove_note($note.id); return false;">remove</a>
		</div>
	</div>
	<div py:if="not read_only" class="note_content" id="edit_note_$note.id" style="display: none;">
		<textarea style="display: block; width: 540px; height: 275px;" id="ta_edit_note_$note.id" name="content" rows="16" cols="74"></textarea><br/>
		<a href="#" onclick="edit_note($note.id); return false;">save</a>
		<a href="#" onclick="cancel_edit($note.id); return false;">cancel</a>
		<br/>
	</div>
</li>
